<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,html {
            width: 100%;
            height: 100%;
        }

        .light {
            text-align: center;
            color: black;
            width: 100%;
            height: 100%;
        }

        .dark {
            text-align: center;
            color: blue;
            width: 100%;
            height: 100%;
        }

    </style>
</head>
<body>
     <input type="button" value="切换黑夜模式" class="btn" onclick="ChangeLight()">
     <br>
     <br>
     <br>
     <div class="light">
        莲花，出淤泥而不染，濯清涟而不妖，她是大自然的瑰宝，赋予了生命无尽的纯净与美好。<br>  
        那一朵朵盛开的莲花，如同一位位娴静的女子，柔美、优雅而脱俗。<br>
        花瓣层层叠叠，洁白如雪，细腻如丝，仿佛是天上云朵降落人间，轻轻覆盖在池塘的水面上。<br>
        每一片花瓣都是精心雕琢的艺术品，温润而清新，散发着淡淡的香气，仿佛将世间的烦忧一一消散。<br>
     </div>
</body>
<script>
      let element = document.querySelector('div');
      let Body = document.querySelector('body');
    function ChangeLight(){
        let butt = document.querySelector('.btn');
        if(element.className == 'light')
        {
            butt.value = "切换白天模式"
            element.className = "dark";
            Body.style.backgroundColor = "black";
        }
        else 
        {
            butt.value = "切换黑夜模式"
           element.className = "light";
           Body.style.backgroundColor = "white";
        }
    }
</script>
</html>